package com.lixun.passwordbook.pojo;



public class Constant {
    /**
     * 密码加密处理
     * */
    public static final String SALT="Lao8secretXiaoburger";

    private static final String[] KEYS = {"W","x","Q","!","@","+","F","?","","&","5","G","s","f","l","p"};

    //用户输入密码后存储为密钥
    private static String KEY = "1234567890123456";

    private static String NewKEY = "1234567890123456";

    public static String getKEY() {
        return KEY;
    }

    public static void setKEY(String KEY) {
        for (int i = 0; i < 17; i++) {
            if (KEY.length() == 16){
                break;
            }
            KEY = KEYS[i] + KEY;
        }
        Constant.KEY = KEY;
    }

    public static String getNewKEY() {
        return NewKEY;
    }

    public static void setNewKEY(String KEY) {
        for (int i = 0; i < 17; i++) {
            if (KEY.length() == 16){
                break;
            }
            KEY = KEYS[i] + KEY;
        }
        Constant.NewKEY = KEY;
    }
}
